<!DOCTYPE html>
<html>
<head>
  <title>在线画图</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    body {
      font-family: Arial, sans-serif;
      max-width: 800px;
      margin: 0 auto;
      padding: 20px;
    }
    h1 {
      text-align: center;
    }
    form {
      display: flex;
      flex-direction: column;
    }
    textarea {
      resize: vertical;
      min-height: 100px;
      margin-bottom: 10px;
      padding: 10px;
      font-size: 16px;
    }
    button {
      padding: 10px;
      font-size: 16px;
      background-color: #007BFF;
      color: white;
      border: none;
      cursor: pointer;
    }
    button:disabled {
      background-color: #ccc;
      cursor: not-allowed;
    }
  </style>
</head>
<body>
  <h1>在线画图</h1>
  <form action="/generate" method="GET">
    <textarea name="prompt" placeholder="请输入prompt" required></textarea>
    <button type="submit" id="generateBtn">生成图片</button>
  </form>

  <script>
    const generateBtn = document.getElementById('generateBtn');
    const form = document.querySelector('form');

    form.addEventListener('submit', (event) => {
      generateBtn.disabled = true;
      generateBtn.textContent = '生成中...';
    });
  </script>
</body>
</html>
